/*************************************************
 * 
 * Copyright by Bruno Eberhard
 * 
 * Created on 31.07.2005
 *
 *************************************************/
package fightplan.views.tables;

import java.awt.Color;

import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.JTextField;

import fightplan.ui.LimitedDocument;

@SuppressWarnings("serial")
public class LimitedCellEditor extends DefaultCellEditor {

	public LimitedCellEditor(int maxSize) {
		super(change(new JTextField(new LimitedDocument(maxSize), null, 0)));
	}

	private static JTextField change(JTextField field) {
		field.setBorder(BorderFactory.createLineBorder(Color.BLACK));
		return field;
	}

}
